package org.example.mybatis3.service;

import org.example.mybatis3.entity.blog.Blog;
import org.example.mybatis3.mapper.BlogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogService {
    @Autowired
    private BlogMapper blogMapper;
    public Blog selectBlogWithAuthor(Long id) {
        return blogMapper.selectBlogWithAuthor(id);
    }
    public Blog selectBlogWithAuthorBySelect(Long id) {
        return blogMapper.selectBlogWithAuthorBySelect(id);
    }

    public List<Blog> selectAllBlogs() {
        return blogMapper.selectAllBlogs();
    }

    public List<Blog> selectAllBlogsWithAuthor() {
        return blogMapper.selectAllBlogsWithAuthor();
    }

    public Blog selectBlogWithPostsBySelect(Long id) {
        return blogMapper.selectBlogWithPostsBySelect(id);
    }

    public Blog selectBlogWithPosts(Long id) {
        return blogMapper.selectBlogWithPosts(id);
    }
}
